#!/bin/sh -e

mkdir bin

(
  echo time
) | (
  while read n
  do
    okabi | (
      while read abi
      do
        okc-$abi | (
          while read c
          do
            echo "=== `date` === Trying $n.c with $c..." >&2
            rm -f sinceepoch.c
	    cp $n.c sinceepoch.c || continue
            $c -o sinceepoch sinceepoch.c || continue
	    cp sinceepoch bin/sinceepoch
            exit 0
          done
          exit 111
        ) && exit 0
      done
      exit 111
    ) && exit 0
  done
  exit 111
)
